# -*- coding:utf-8 -*-
"""
Author：Administrator
Date:2021年10月12日
"""
import pandas as pd
pd.set_option('display.width', 1000)

path = '../数据文件/课件020/销售.xlsx'
data = pd.read_excel(path,header=[0,1])

# result1 = data[('土豆', '销量')] + data[('倭瓜', '销量')]
# result1 = data['土豆']+ data['倭瓜']
total = data['土豆']+ data['倭瓜']
total.columns = pd.MultiIndex.from_product([['合计'], total.columns])
# print(data)
# print(data.columns)
# print(result1)

result = pd.concat([data, total], axis=1)
# result.to_excel('./数据文件/课件020/结果.xlsx')
print(result)